import cv2


class ImageViewer:
    def __init__(self):
        super().__init__()

        self.initUI()

    def initUI(self):
        # 加载图片
        image_path = "oil_1.png"
        img = cv2.imread(image_path)
        if img is not None:
            cv2.imshow("Image Viewer", img)
            cv2.waitKey(0)


if __name__ == '__main__':
    ex = ImageViewer()